package com.css.fxfzypg.modules.dpzs.controller;

import com.css.fxfzypg.base.response.RestResponse;
import com.css.fxfzypg.modules.dpzs.service.DpzsService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

@Slf4j
@RestController
@RequestMapping("/dpzs")
public class DpzsController {
    @Autowired
    private DpzsService dpzsService;

    //excel数据的导入
    @PostMapping("dataImport/{attachId}")
    public RestResponse dataImport(@PathVariable String attachId) {
        String message = null;
        try {
            message = dpzsService.excelReader(attachId);
        } catch (Exception e) {
            log.error(e.getMessage());
            return RestResponse.fail("导入失败");
        }
        return RestResponse.succeed(message);
    }

}
